/****************************************************
* Unity版本：2022.1.21f1c1
* Version：0.1
* Company：DefaultCompany
* 日期：2023/08/22 14:53:38
*****************************************************/

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ShperePhysicalController : MonoBehaviour
{
    private Rigidbody rd;//刚体变量

    public int force = 1;//力量

    void Start()
    {
        rd = GetComponent<Rigidbody>();
    }

    void Update()
    {
        float h = Input.GetAxis("Horizontal");

        float v = Input.GetAxis("Vertical");
        Vector3 forword = transform.forward * v * force;
        Vector3 right = transform.right * h * force;
        Debug.Log($"h:{right}  v:{forword}");
        rd.AddForce(forword);
        rd.AddForce(right);
    }
}
